﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Entities;
/// <summary>
/// Summary description for ProductManager
/// </summary>
public class ProductManager
{
    private ProductData data;
    public ProductManager()
    {
        data = new ProductData();
    }

    public IEnumerable<Product> AllProduct()
    {
        return data.AllProduct();
    }

    public IEnumerable<Product> SeachrProductByName(string name)
    {
        return data.SearchProductByName(name);
    }

    public IEnumerable<Product> SearchProductByPrice(decimal price)
    {
        return data.SearchProductByPrice(price);
    }

    public void SortProductByName(bool isDesending)
    {

    }

    public Product GetProductById(int id)
    {
        return data.GetProductById(id);
    }

    public bool AddNewProduct(Product pro)
    {
        return data.AddNewProduct(pro);
    }

    public void DeleteProduct(int id)
    {
        data.DeleteProductById(id);
    }

    public void EditProduct(Product pro)
    {
        data.EditProduct(pro);
    }

    public IEnumerable<Product> GetProductByCategory(int cid)
    {
        return data.getProductByCategory(cid);
    }

    public IEnumerable<Product> GetProductBySupplier(int sid)
    {
        return data.getProductBySupplier(sid);
    }

    public IEnumerable<Product> SearchProductByPrice(int bPrice, int ePrice)
    {
        return data.SearchProductByPrice(bPrice, ePrice);
    }
}